package day05;

abstract class  Student {
    protected String studentId;
    protected String name;
    protected char gender;
    protected int age;

    public Student(String studentId, String name, char gender, int age) {
        this.studentId = studentId;
        this.name = name;
        this.gender = gender;
        this.age = age;
    }

    public abstract double calculateTotalScore();{

    }

    @Override
    public String toString() {
        return "学号:" + studentId + " 姓名：" + name + " 性别：" + gender + " 年龄：" + age + " 综合成绩：" + calculateTotalScore();
    }
}

class EnglishStudent extends Student {
    private int speechScore;
    private int finalExamScore;
    private int midExamScore;

    public EnglishStudent(String studentId, String name, char gender, int age) {
        super(studentId, name, gender, age);
    }

    @Override
    public double calculateTotalScore() {
        return (speechScore * 0.5 + finalExamScore * 0.25 + midExamScore * 0.25);
    }

    public void setSpeechScore(int speechScore) {
        this.speechScore = speechScore;
    }

    public void setFinalExamScore(int finalExamScore) {
        this.finalExamScore = finalExamScore;
    }

    public void setMidExamScore(int midExamScore) {
        this.midExamScore = midExamScore;
    }
}



